#include "qpimapitem.h"

QpimapItem::QpimapItem(const QString & fileName,QGraphicsScene *scence)
{
    pixmap.load(fileName);
    scence->addItem(this);
}
QRectF QpimapItem::boundingRect() const
{

    return QRectF(-pixmap.width()/2,-pixmap.height(),pixmap.width() ,pixmap.height());
}

void QpimapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->drawPixmap(-pixmap.width()/2,-pixmap.height(),pixmap);
}
